layui.use(['layer'], function () {
    const layer = parent.layer === undefined ? layui.layer : top.layer,
        $ = layui.jquery;

    $.ajax({
        url: $.cookie("tempUrl") + "hOmsOrderInterrogation/selectById?id=" + $.cookie('tempId'),
        type: "GET",
        success: function (result) {
            if (result.code === 200) {
                $(".createTime").append(result.data.createTime);
                let stat;
                switch (result.data.stat) {
                    case 1:
                        stat = "已预约";
                        break;
                    case 2:
                        stat = "已完成";
                        break;
                    case 3:
                        stat = "未完成";
                        break;
                    case 4:
                        stat = "已退款";
                        break;
                    case 5:
                        stat = "未支付";
                        break;
                }
                $(".stat").append(stat);


                $.ajax({
                    url: $.cookie("tempUrl") + "hMember/selectByPrimaryKey?memberId=" + result.data.memberId,
                    type: "GET",
                    success: function (result) {
                        if (result.code === 200) {
                            $(".name").append(result.data.name);
                            $(".gender").append(result.data.gender === 1 ? "男" : "女");
                            $(".age").append(result.data.age);
                            $(".memberPhone").append(result.data.phone);
                            $(".sid").append(result.data.sid);
                        }
                    }
                });
            } else {
                layer.msg(result.exception, {icon: 7, anim: 6});
            }
        }
    });
});